@import './theme/default.less';
@normal-color: @theme-stroke-1;
@cart-color: @theme-stroke-3;
@wait-color: @theme-stroke-4;
@error-color: @theme-error-2;
@bg-color: @theme-stroke-9;
@current-bg-color: @theme-primary-2;
@icon-color: @theme-stroke-6;

.zent-steps {
  width: 100%;
  line-height: 1.5;
  font-size: 0;
  display: flex;
  box-sizing: border-box;
}

.zent-steps-tail {
  position: absolute;
  width: 100%;
  left: 0;
  top: 10px;
  box-sizing: border-box;
  margin-left: 55px;

  i {
    display: inline-block;
    position: relative;
    width: 100%;
    border-radius: 1px;
    height: 3px;
    vertical-align: top;
    background: @icon-color;

    &::after {
      content: '';
      position: absolute;
      top: 0;
      width: 0;
      background: @wait-color;
      height: 100%;
      opacity: 0;
    }
  }
}

.zent-steps-step {
  position: relative;

  .zent-step-head {
    position: relative;
    display: inline-block;
    vertical-align: top;
    background: @theme-stroke-10;
    margin-left: 45px;
    box-sizing: border-box;
  }

  .zent-step-main {
    position: relative;
    vertical-align: top;
    width: 120px;
    color: @theme-stroke-4;
    text-align: center;

    .zent-step-title {
      font-size: 14px;
      max-width: 120px;
      line-height: 14px;
      margin-top: 10px;
      word-wrap: break-word;
      word-break: break-all;
    }

    .zent-step-description {
      max-width: 120px;
      font-size: 12px;
      line-height: 16px;
      margin-top: 5px;
      word-wrap: break-word;
      word-break: break-all;
    }
  }
}

.zent-step-head-inner {
  margin: 0 5px;
  font-size: 20px;
  color: @icon-color;
  line-height: 20px;

  .zent-icon {
    display: inline-block;
    vertical-align: middle;
    width: 20px;
    height: 20px;
    line-height: 20px;
    border-radius: 50%;
    text-align: center;
    background: @icon-color;
    color: @theme-stroke-10;
    font-size: 12px;
  }

  .zenticon {
    vertical-align: middle;
  }
}

.zent-steps-item {
  position: relative;
  display: inline-block;
  vertical-align: top;
  overflow: visible;
  flex: 1;

  &.zent-steps-status-finish {
    &.is-current {
      .zent-steps-tail {
        i {
          &::after {
            width: 0;
          }
        }
      }
    }

    &.is-last-finish {
      .zent-steps-tail {
        i {
          &::after {
            width: 100%;
          }
        }
      }
    }

    .zent-step-head-inner {
      color: @current-bg-color;

      .zent-icon {
        background: @current-bg-color;
      }
    }

    .zent-step-main {
      .zent-step-title {
        color: @normal-color;
      }
    }

    .zent-steps-tail {
      i {
        &::after {
          width: 100%;
          background: @current-bg-color;
          transition: all 0.2s ease;
          opacity: 1;
        }
      }
    }
  }

  &.zent-steps-status-error {
    .zent-step-head-inner {
      color: @error-color;
    }

    .zent-step-main {
      .zent-step-title {
        color: @error-color;
      }
    }
  }

  &.zent-steps-status-process {
    .zent-step-head-inner {
      .zent-icon {
        background: @current-bg-color;
      }
    }
  }

  &:last-child {
    flex: none;

    .zent-steps-tail {
      display: none;
    }
  }
}

.zent-steps__vertical {
  display: block;

  .zent-steps-item {
    display: block;
    overflow: visible;

    &.zent-steps-status-finish {
      &.is-current {
        .zent-steps-tail {
          i {
            &::after {
              width: 100%;
              height: 0;
            }
          }
        }
      }

      &.is-last-finish {
        .zent-steps-tail {
          i {
            &::after {
              width: 100%;
            }
          }
        }
      }

      .zent-steps-tail {
        i {
          &::after {
            width: 100%;
          }
        }
      }
    }
  }

  .zent-steps-tail {
    position: absolute;
    margin-left: 0;
    width: 2px;
    left: 14px;
    top: 0;
    height: 100%;
    padding: 30px 0 4px;

    i {
      height: 100%;
      width: 2px;

      &::after {
        width: 100%;
      }
    }
  }

  .zent-steps-step {
    .zent-step-head {
      float: left;
      margin-left: 0;
    }

    .zent-step-main {
      display: block;
      overflow: hidden;
      min-height: 48px;
      text-align: left;
      width: inherit;

      .zent-step-title {
        margin-top: 0;
        line-height: 22px;
        max-width: initial;
      }

      .zent-step-description {
        padding-bottom: 15px;
        max-width: initial;
      }
    }
  }

  .zent-step-head-inner {
    margin-right: 8px;
  }
}

.zent-steps-card {
  .zent-steps-item {
    box-sizing: border-box;
    padding: 0 1px;

    &.is-clicked {
      cursor: pointer;
    }

    &:first-child {
      padding-left: 0;
    }

    &:last-child {
      padding-right: 0;
    }

    .zent-steps-step {
      height: 50px;
      line-height: 50px;
      font-size: 16px;
      background: @bg-color;
      color: @cart-color;
      text-align: center;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
      padding: 0 10px;
    }

    &.is-current {
      .zent-steps-step {
        background: @current-bg-color;
        color: @theme-stroke-10;
      }
    }
  }
}

.zent-steps-breadcrumb {
  overflow: hidden;

  .zent-steps-item {
    padding: 0 8px;
    box-sizing: border-box;

    &.is-clicked {
      cursor: pointer;
    }

    &:first-child {
      padding-left: 0;

      .zent-steps-step {
        &::before {
          display: none;
        }
      }
    }

    &:last-child {
      padding-right: 0;

      .zent-steps-step {
        &::after {
          display: none;
        }
      }
    }

    .zent-steps-step {
      height: 44px;
      line-height: 44px;
      font-size: 14px;
      background: @bg-color;
      color: @cart-color;
      text-align: center;
      padding: 0 10px;

      &::after {
        content: ' ';
        display: block;
        width: 0;
        height: 0;
        border-top: 22px solid transparent;
        border-bottom: 22px solid transparent;
        border-left: 12px solid @bg-color;
        position: absolute;
        top: 50%;
        margin-top: -22px;
        right: -12px;
      }

      &::before {
        content: ' ';
        display: block;
        width: 0;
        height: 0;
        border-top: 22px solid @bg-color;
        border-bottom: 22px solid @bg-color;
        border-left: 12px solid transparent;
        position: absolute;
        top: 50%;
        margin-top: -22px;
        left: -12px;
      }
    }

    &.is-finish {
      .zent-steps-step {
        background: @current-bg-color;
        color: @theme-stroke-10;

        &::after {
          border-left-color: @current-bg-color;
        }

        &::before {
          border-top-color: @current-bg-color;
          border-bottom-color: @current-bg-color;
        }
      }
    }
  }
}
